
import type { LowCodeDataLinkSqlCFG, LowcodeField, LowcodePagePanelComponentItem, LowcodePageSearchItem, LowcodeValidateItemCFG, LowCodeWhereListItem } from "../interface";

export interface ComponentPropsHookProxy {};

export interface ComponentPropsFunProxy {
  componentType?: string;
  confObject?: LowcodePagePanelComponentItem | LowcodePageSearchItem;
  dataObject?: any;
  parentSrc?: string;
};

export interface LowcodeDefHookProxy {
  mdCode?: string;
};

export interface GenerateLowcodeDefProxy {
  // rowIdx?: number;
  panelType?: string;
  // maxSortVal?: number;
  Components?: LowcodePagePanelComponentItem[];
  editTbName?: string;
  panelData?: any[];
};

export interface DataEventHookProxy {
  mdCode?: string;
  // itemsConfig?: LowcodePagePanelComponentItem[];
}

export interface DataEventProxy {
  record: any;
  fieldName: string;
  newValue: any;
  itemsConfig?: LowcodePagePanelComponentItem[];
}

export interface FetchScriptProxy {
  title: string;
  record: any;
  sqlRule: LowCodeDataLinkSqlCFG;
}

export interface FetchScriptReq {
  RowData: any;
  DataEventItems: {
    [key: string]: { Title: string; ServiceName: string; FetchSql: string }
  }
}

export interface FetchScriptRes {
  DataEventItems: { [key: string]: { ErrorMsg: string; DataItems: any } }
}

export interface ValidatorHookProxy { mdCode?: string; }

export interface ValidatorProxy {
  value: any;
  validateItems: LowcodeValidateItemCFG[];
  valType: "string" | "number";
  // srcFrom: "table" | "form";
  rowData?: { [key: string]: any };
}

export interface ValidateSqlFetch {
  ValidateSql?: string;
  RowData?: object;
  WhereList?: LowCodeWhereListItem[];
  ServiceName?: string;
}

export interface ValidateFetchScriptRes {
  Flag?: string;
  ErrorMsg?: string;
}

export interface LowcodeMenuBtnsHookProxy {}

export interface LowcodeMenuBtnBasicProxy {
  BillId?: string;
  UserNo?: string;
  ModuleCode?: string;
}

export interface LowcodeMenuBtnDelProxy extends LowcodeMenuBtnBasicProxy {}

export interface LowcodeMenuBtnCancelProxy extends LowcodeMenuBtnBasicProxy {}

export interface LowcodeMenuBtnAuditProxy extends LowcodeMenuBtnBasicProxy {}

export interface LowcodeBillDisabledProxy {
  mdLimit?: string;
  isSystemDictDisable?: string;
  field?: { [key: string]: string };
  editableStatus?: string;
  disableStatus?: string[];
  mainData?: { [key: string]: any };
  approving?: boolean;
}

export interface LowcodeSaveTableConfig {
  tableName: string;
  primaryKeys: string[];
  ignore?: string[];
}

export interface LowcodeTableSaveData {
  NewList: any[];
  ModifiedList: any[];
  DelList: any[];
}

export interface LowcodeMenuBtnSaveProxy {
  BillId?: string;
  uniqueKey?: string;
  ModuleCode?: string;
  mainData?: { [key: string]: any };
  tableData?: LowcodeTableSaveData[];
  mainTable?: LowcodeSaveTableConfig;
  detailListTable?: LowcodeSaveTableConfig[];
  fieldConf?: LowcodeField;
}


export interface LowcodeSaveListProxy extends LowcodeTableSaveData, LowcodeSaveTableConfig {
	ModuleCode : string;
	fieldConf ?: LowcodeField;
}